package cn.bincker.mybatis.encrypt.converter.impl;

import java.nio.ByteBuffer;
import java.sql.Time;

public class SqlTimeEncryptConverter extends BaseEncryptConverter<Time> {
    @Override
    public Time convertNonNull(byte[] data) {
        return new Time(ByteBuffer.wrap(data).getLong());
    }

    @Override
    public byte[] convertNonNull(Time object) {
        var result = new byte[Long.BYTES];
        ByteBuffer.wrap(result).putLong(object.getTime());
        return result;
    }
}
